﻿var EditMenusController = function ($scope) {
    $.ajax({
        url: '/Data/GetMenus',
        async: false,
        success: function (result) {
            $scope.menuItems = result;

        }
    });


    $scope.$on('mapInitialized', function (evt, evtMap) {
        $scope.map = evtMap;


        $scope.addMarker = function (location) {
            var marker = new google.maps.Marker({
                position: location,
                map: $scope.map
            });
            $scope.markers.push(marker);
        }

        $scope.clearMarkers = function (location) {
            for (var i = 0; i < $scope.markers.length; i++) {
                $scope.markers[i].setMap(null);
            }
            $scope.markers = [];
        }


        $scope.treeNodeClicked = function () {
            debugger;
            $scope.MenuId = $scope.menuTree.currentNode.ID;
        };
    });

}

EditMenusController.$inject = ['$scope'];